import { v4 as uuid } from 'uuid';
import query from './atom/db/query';

declare const action_id: string;
declare const session_id: string;
declare const spaceid: string;

function format(d: number) {
	const dt = new Date(d);
	return dt.getFullYear() + '-' + (((dt.getMonth() + 1) < 10) ? ('0' + (dt.getMonth() + 1)) : (dt.getMonth() + 1)) + '-' + ((dt.getDate() < 10) ? ('0' + (dt.getDate())) : (dt.getDate()));
}

interface Message {
	department_no: string;
}

async function atom(msg: Message) {
	const systemid = '5991';
	const { prepare, exec } = query(action_id, session_id, spaceid, systemid);
	prepare('specialty', ['major_no', 'major', 'department_no'], msg);
	const [ret] = await exec();
	return ret;
}
